package com.example.understandvideo.service;

import com.example.understandvideo.mapper.LogDao;
import com.example.understandvideo.pojo.Log;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class LogService {
    @Resource
    private LogDao logDao;

    public void logSmartMsg(Long sourceId, String message) {
        Log log = new Log();
        log.setContent(message);
        log.setSourceId(sourceId);
        log.setSourceType("smart_task");
        logDao.insert(log);
    }

    public void logAnalysisMsg(Long sourceId, String message) {
        Log log = new Log();
        log.setContent(message);
        log.setSourceId(sourceId);
        log.setSourceType("analysis_task");
        logDao.insert(log);
    }

    public void logAsrMsg(Long sourceId, String message) {
        Log log = new Log();
        log.setContent(message);
        log.setSourceId(sourceId);
        log.setSourceType("asr_task");
        logDao.insert(log);
    }
}
